﻿import QtQuick 2.7
import QtQuick.Controls 1.4
import QtQuick.Controls 2.0
import QtQuick.Controls.Styles 1.2
import QtQuick.Layouts 1.0
import QtQuick.Layouts 1.1

ApplicationWindow {
    title: "设置"

    visible: true
    minimumHeight: 400
    minimumWidth: 700
    maximumHeight: 400
    maximumWidth: 700

    ColumnLayout {
        id: topLayout
        anchors.fill: parent
        anchors.margins: 10

        RowLayout {
            id: main
            anchors.left: parent.left

            ColumnLayout {
                id: titles

                TextField {
                    placeholderText: "搜索..."
                    focus: true
                }

                ListView {
                    id: categories
                    width: 100
                    Layout.fillHeight: parent.height
                    spacing: height / (categories.count * 2)
                    clip: true

                    model: tabs

                    delegate: Text {
                        text: title
                    }

                    MouseArea {
                        z: 10
                        hoverEnabled: false
                        anchors.fill: parent
                        onClicked: {
                            categories.currentIndex = index;
                        }
                    }
                }
            }

            ColumnLayout {
                id: editorLayout

                anchors.left: titles.right
                anchors.right: parent.right
                anchors.bottom: parent.bottom
                anchors.top: parent.top

                anchors.leftMargin: 10

                Rectangle {
                    radius: 5
                    anchors.fill: parent
                    border.color: "gray"
                    border.width: 1

                }
            }
        }
    }

    ListModel {
        id: tabs

        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "通用"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "状态"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "聊天"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "多媒体"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "文件传输"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "聊天"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "声音"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "服务器"
        }
        ListElement {
            icon: "qrc:/images/settings_multimedia.png"
            title: "更新"
        }
     }
}
